<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=c, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
    /* var str = '121'
    var num = parseInt(str)
    console.log(typeof num)
    console.log(str/1)隐式转换
    var str2 = '18px'
    var num2 = parseInt(str2)
    console.log(num2)
    var str3 = 'px1212'
    var num3 = parseInt(str3)
    console.log(num3)
    var str4 = '12.12'
    var num4 = parseFloat(str4)
    
    console.log( typeof num4)
    var str5 = '1212px'
    var num5 =Number(str5)
    console.log(num5) */


//转换为字符串型
/*  var num = 12;
 var str = num.toString()
 console.log(typeof str)
 console.log(typeof(String(num)))
 console.log(typeof(num+'')) */

 //转换为布尔值
 
  console.log(Boolean(12))
  console.log(Boolean(0))
  console.log(Boolean(' '))
    </script>
</body>
</html>